/*
 * Itmes, clase madre
 *
 * This is part of the game The Rooms
 * Copyright (C) 2010  Elvio Sarquis
 *
 * Get the GNU GPL v3 in http://www.gnu.org/licenses/
 */

package rooms.items;

import rooms.C;
import utils.Point;

/**
 *
 * @author dask
 */
public abstract class Item {

    private String name;
    private String description;
    private int weight;
    private int price;
    private int color;
    private char symbol;
    private Point position = new Point();

    public Item(){

        name = "Complety Generic Object";
        description = "A complety generic object.";
        weight = 1;
        price = 0;
        color = C.GREEN;
        symbol = '*';
    }

    public Item(String name, String description, int x ,int y, int weight, int price, int color, char symbol){

        this.name = name;
        this.weight = weight;
        this.price = price;
        this.color = color;
        this.symbol = symbol;
        this.description = description;
        this.position.x(x);
        this.position.y(y);
    }

    public Item(Item item){

        this.name = item.name;
        this.description = item.description;
        this.weight = item.weight;
        this.price = item.price;
        this.color = item.color;
        this.symbol = item.symbol;
        this.position.x(item.position.x());
        this.position.y(item.position.y());
    }

// <editor-fold defaultstate="collapsed" desc="Is">
    public boolean isConsumable() {
        return this instanceof Comsumable;
    }

    public boolean isWeapon() {
        return this instanceof Weapon;
    }

    public boolean isArmour() {
        return this instanceof Armor;
    }

    public boolean isJunk() {
        return this instanceof Junk;
    }

    public boolean isContainer() {
        return this instanceof Container;
    }// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="Getters">
    public String getName() {
        return name;
    }

    public String getDescription() {
        return description;
    }

    public int getWeight() {
        return weight;
    }

    public int getPrice() {
        return price;
    }

    public int getColor() {
        return color;
    }

    public char getSymbol() {
        return symbol;
    }

    public int getX() {
        return position.x();
    }
    
    public int getY() {
        return position.y();
    }// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="Setters">
    public void setName(String name) {
        this.name = name;
    }

    public void setDescrption(String description) {
        this.description = description;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public void setColor(int color) {
        this.color = color;
    }

    public void setSymbol(char symbol) {
        this.symbol = symbol;
    }

    public void setX(int x) {
        position.x(x);
    }

    public void setY(int y) {
        position.y(y);
    }// </editor-fold>
}
